/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ronsicecream.pos.entities;

import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author user
 */
@Entity
@Table(name = "pos_transaction_ho_purchase_order_supplier_detail")
@XmlRootElement
//@NamedQueries({
//    @NamedQuery(name = "PosTransactionHoPurchaseOrderSupplierDetail.findAll", query = "SELECT p FROM PosTransactionHoPurchaseOrderSupplierDetail p"),
//    @NamedQuery(name = "PosTransactionHoPurchaseOrderSupplierDetail.findBySync", query = "SELECT p FROM PosTransactionHoPurchaseOrderSupplierDetail p WHERE p.sync = :sync"),
//    @NamedQuery(name = "PosTransactionHoPurchaseOrderSupplierDetail.findByPurchaseOrderDetailId", query = "SELECT p FROM PosTransactionHoPurchaseOrderSupplierDetail p WHERE p.purchaseOrderDetailId = :purchaseOrderDetailId"),
//    @NamedQuery(name = "PosTransactionHoPurchaseOrderSupplierDetail.findByPurchaseOrderDetailQuantity", query = "SELECT p FROM PosTransactionHoPurchaseOrderSupplierDetail p WHERE p.purchaseOrderDetailQuantity = :purchaseOrderDetailQuantity"),
//    @NamedQuery(name = "PosTransactionHoPurchaseOrderSupplierDetail.findByPurchaseOrderDetailSent", query = "SELECT p FROM PosTransactionHoPurchaseOrderSupplierDetail p WHERE p.purchaseOrderDetailSent = :purchaseOrderDetailSent"),
//    @NamedQuery(name = "PosTransactionHoPurchaseOrderSupplierDetail.findByPurchaseOrderDetailUnsent", query = "SELECT p FROM PosTransactionHoPurchaseOrderSupplierDetail p WHERE p.purchaseOrderDetailUnsent = :purchaseOrderDetailUnsent"),
//    @NamedQuery(name = "PosTransactionHoPurchaseOrderSupplierDetail.findByPurchaseOrderDetailPrice", query = "SELECT p FROM PosTransactionHoPurchaseOrderSupplierDetail p WHERE p.purchaseOrderDetailPrice = :purchaseOrderDetailPrice")})
public class PosTransactionHoPurchaseOrderSupplierDetail implements Serializable {
    private static final long serialVersionUID = 1L;
    @Column(name = "sync")
    private String sync;
    @Id
    @Basic(optional = false)
    @Column(name = "purchase_order_detail_id")
    private Integer purchaseOrderDetailId;
    @Column(name = "purchase_order_detail_quantity")
    private BigDecimal purchaseOrderDetailQuantity;
    @Column(name = "purchase_order_detail_sent")
    private BigDecimal purchaseOrderDetailSent;
    @Column(name = "purchase_order_detail_unsent")
    private BigDecimal purchaseOrderDetailUnsent;
    @Column(name = "purchase_order_detail_price")
    private BigDecimal purchaseOrderDetailPrice;
    @Lob
    @Column(name = "purchase_order_detail_description")
    private String purchaseOrderDetailDescription;
    @JoinColumn(name = "purchase_order_detail_purchase_order_id", referencedColumnName = "purchase_order_id")
    @ManyToOne
    private PosTransactionHoPurchaseOrderSupplier purchaseOrderDetailPurchaseOrderId;
    @JoinColumn(name = "purchase_order_detail_item_id", referencedColumnName = "item_id")
    @ManyToOne(optional = false)
    private PosMasterItem purchaseOrderDetailItemId;

    public PosTransactionHoPurchaseOrderSupplierDetail() {
    }

    public PosTransactionHoPurchaseOrderSupplierDetail(Integer purchaseOrderDetailId) {
        this.purchaseOrderDetailId = purchaseOrderDetailId;
    }

    public String getSync() {
        return sync;
    }

    public void setSync(String sync) {
        this.sync = sync;
    }

    public Integer getPurchaseOrderDetailId() {
        return purchaseOrderDetailId;
    }

    public void setPurchaseOrderDetailId(Integer purchaseOrderDetailId) {
        this.purchaseOrderDetailId = purchaseOrderDetailId;
    }

    public String getPurchaseOrderDetailDescription() {
        return purchaseOrderDetailDescription;
    }

    public void setPurchaseOrderDetailDescription(String purchaseOrderDetailDescription) {
        this.purchaseOrderDetailDescription = purchaseOrderDetailDescription;
    }

    public PosTransactionHoPurchaseOrderSupplier getPurchaseOrderDetailPurchaseOrderId() {
        return purchaseOrderDetailPurchaseOrderId;
    }

    public void setPurchaseOrderDetailPurchaseOrderId(PosTransactionHoPurchaseOrderSupplier purchaseOrderDetailPurchaseOrderId) {
        this.purchaseOrderDetailPurchaseOrderId = purchaseOrderDetailPurchaseOrderId;
    }

    public BigDecimal getPurchaseOrderDetailQuantity() {
        return purchaseOrderDetailQuantity;
    }

    public void setPurchaseOrderDetailQuantity(BigDecimal purchaseOrderDetailQuantity) {
        this.purchaseOrderDetailQuantity = purchaseOrderDetailQuantity;
    }

    public BigDecimal getPurchaseOrderDetailSent() {
        return purchaseOrderDetailSent;
    }

    public void setPurchaseOrderDetailSent(BigDecimal purchaseOrderDetailSent) {
        this.purchaseOrderDetailSent = purchaseOrderDetailSent;
    }

    public BigDecimal getPurchaseOrderDetailUnsent() {
        return purchaseOrderDetailUnsent;
    }

    public void setPurchaseOrderDetailUnsent(BigDecimal purchaseOrderDetailUnsent) {
        this.purchaseOrderDetailUnsent = purchaseOrderDetailUnsent;
    }

    public BigDecimal getPurchaseOrderDetailPrice() {
        return purchaseOrderDetailPrice;
    }

    public void setPurchaseOrderDetailPrice(BigDecimal purchaseOrderDetailPrice) {
        this.purchaseOrderDetailPrice = purchaseOrderDetailPrice;
    }

    public PosMasterItem getPurchaseOrderDetailItemId() {
        return purchaseOrderDetailItemId;
    }

    public void setPurchaseOrderDetailItemId(PosMasterItem purchaseOrderDetailItemId) {
        this.purchaseOrderDetailItemId = purchaseOrderDetailItemId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (purchaseOrderDetailId != null ? purchaseOrderDetailId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PosTransactionHoPurchaseOrderSupplierDetail)) {
            return false;
        }
        PosTransactionHoPurchaseOrderSupplierDetail other = (PosTransactionHoPurchaseOrderSupplierDetail) object;
        if ((this.purchaseOrderDetailId == null && other.purchaseOrderDetailId != null) || (this.purchaseOrderDetailId != null && !this.purchaseOrderDetailId.equals(other.purchaseOrderDetailId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.ronsicecream.pos.entities.PosTransactionHoPurchaseOrderSupplierDetail[ purchaseOrderDetailId=" + purchaseOrderDetailId + " ]";
    }
    
}
